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
# netstat -an | grep
tcp        0      0           TIME_WAIT

2. IP removed on certain interface - ifconfig
# ifconfig -a | grep
# ifconfig eth0.800:wAAAA netmask
# ifconfig -a | grep
          inet addr:  Bcast:  Mask:

PS. extra info of IP before removed - ifconfig
eth0.800:wAAAA Link encap:Ethernet  HWaddr 52:54:00:50:00:60
          inet addr:  Bcast:  Mask:

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: Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.