summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallfro <ndouba@gmail.com>2011-07-23 18:43:19 -0700
committerallfro <ndouba@gmail.com>2011-07-23 18:43:19 -0700
commitea786c2457498e708b0734c233a4292529cc2e2d (patch)
tree595ce62a6778dbaa5f9e222c8a30c08a8e3f149f
parente20d0bcb9d3eed803bdcd547dbf88b1954204332 (diff)
downloadlibnet-ea786c2457498e708b0734c233a4292529cc2e2d.tar.gz
Fixes a bug that incorrectly converts the addr, mask, and next_hop fields to network byte order. Users will usually call libnet_name2addr4 to fill these fields and this function already provides a network byte-ordered value.
-rw-r--r--libnet/src/libnet_build_rip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libnet/src/libnet_build_rip.c b/libnet/src/libnet_build_rip.c
index 911d0cf..52a2db7 100644
--- a/libnet/src/libnet_build_rip.c
+++ b/libnet/src/libnet_build_rip.c
@@ -73,9 +73,9 @@ libnet_ptag_t ptag)
rip_hdr.rip_rd = htons(rd);
rip_hdr.rip_af = htons(af);
rip_hdr.rip_rt = htons(rt);
- rip_hdr.rip_addr = htonl(addr);
- rip_hdr.rip_mask = htonl(mask);
- rip_hdr.rip_next_hop = htonl(next_hop);
+ rip_hdr.rip_addr = addr;
+ rip_hdr.rip_mask = mask;
+ rip_hdr.rip_next_hop = next_hop;
rip_hdr.rip_metric = htonl(metric);
n = libnet_pblock_append(l, p, (uint8_t *)&rip_hdr, LIBNET_RIP_H);