diff options
author | Jesse Gross <jesse@nicira.com> | 2010-12-04 13:49:50 -0800 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2010-12-09 17:43:36 -0800 |
commit | 56b20c59a3fbfe94dcbb94fa4abfc013630af541 (patch) | |
tree | 6d11491cb0852b4cdc6a2b89f0ecadef5f302d84 /datapath/vport-capwap.c | |
parent | e7d737d175dfe53436b356445ecb154541d2afff (diff) |
capwap: Bind address should be big endian.
CAPWAP creates a UDP socket that accepts packets from any address using
INADDR_ANY. IP addresses should be in network byte order but that
constant is in host byte order, so use htonl. However, this is not a
real bug since the value of INADDR_ANY is 0.
Found with sparse.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath/vport-capwap.c')
-rw-r--r-- | datapath/vport-capwap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/datapath/vport-capwap.c b/datapath/vport-capwap.c index 3f6f941f..e17d85fa 100644 --- a/datapath/vport-capwap.c +++ b/datapath/vport-capwap.c @@ -237,7 +237,7 @@ static int capwap_init(void) goto error; sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_ANY; + sin.sin_addr.s_addr = htonl(INADDR_ANY); sin.sin_port = htons(CAPWAP_DST_PORT); err = kernel_bind(capwap_rcv_socket, (struct sockaddr *)&sin, |