bind() error 0x63 – Cannot assign requested address

Recently encountered a bind() error 0x63 – cannot assign requested address. After some effort on debugging, I list 2 possibilities here for reference when handling such this error code from bind().  Generally, if it is related with bad socket close/cleanup, we have to fix the bug within application code or wait some time to make sure the scoket is shutdown by OS finally; if it is related with IP removed, we need to add this IP again. May it help.

1. socket state legacy - netstat
<sch01-s00c06h0:root>/root:
# netstat -an | grep 10.206.254.1
tcp        0      0 10.206.254.1:3868           10.206.218.4:33594          TIME_WAIT

2. IP removed on certain interface - ifconfig
<sch01-s00c06h0:root>/root:
# ifconfig -a | grep 10.206.254.1
<sch01-s00c06h0:root>/root:
# ifconfig eth0.800:wAAAA 10.206.254.1 netmask 255.255.128.0
<sch01-s00c06h0:root>/root:
# ifconfig -a | grep 10.206.254.1
          inet addr:10.206.254.1  Bcast:10.206.255.255  Mask:255.255.128.0

PS. extra info of IP before removed - ifconfig
eth0.800:wAAAA Link encap:Ethernet  HWaddr 52:54:00:50:00:60
          inet addr:10.206.254.1  Bcast:10.206.255.255  Mask:255.255.128.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

About daveti

Interested in kernel hacking, compilers, machine learning and guitars.
This entry was posted in Programming and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s