Changeset 1536 for trunk/src/common/sendpacket.c
- Timestamp:
- 07/28/06 22:42:30 (2 years ago)
- Files:
-
- 1 modified
-
trunk/src/common/sendpacket.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/sendpacket.c
r1535 r1536 57 57 * Please note that some of this code was copied from Libnet 1.1.3 58 58 */ 59 60 #include "config.h" 59 61 #include "defines.h" 60 62 #include "common.h" … … 108 110 109 111 #elif defined HAVE_LIBNET 110 #include <libnet.h>111 112 static sendpacket_t *sendpacket_open_libnet(const char *, char *); 112 113 static struct tcpr_ether_addr *get_hwaddr_libnet(sendpacket_t *); … … 182 183 goto TRY_SEND_AGAIN; 183 184 } else if (retcode < 0) { 184 sendpacket_seterr(sp, "Error with libnet_adv_write_link: %s", libnet_geterr (sp->lnet));185 sendpacket_seterr(sp, "Error with libnet_adv_write_link: %s", libnet_geterror(sp->handle.lnet)); 185 186 } 186 187 #endif … … 345 346 assert(errbuf); 346 347 347 if (( lnet = libnet_init(LIBNET_LINK_ADV, device, errbuf)) == NULL)348 if ((sp->handle.lnet = libnet_init(LIBNET_LINK_ADV, device, errbuf)) == NULL) 348 349 return NULL; 349 350 … … 360 361 assert(sp); 361 362 362 addr = (struct tcpr_ether_addr *)libnet_get_hwaddr(sp-> lnet);363 364 if ( ether == NULL) {365 sendpacket_seterr(sp, "Error getting hwaddr via libnet: %s", libnet_geterr (sp->lnet));366 return NULL 367 } 368 369 mem pcy(sp->ether, addr, sizeof(struct tcpr_ether_addr));363 addr = (struct tcpr_ether_addr *)libnet_get_hwaddr(sp->handle.lnet); 364 365 if (addr == NULL) { 366 sendpacket_seterr(sp, "Error getting hwaddr via libnet: %s", libnet_geterror(sp->handle.lnet)); 367 return NULL; 368 } 369 370 memcpy(&sp->ether, addr, sizeof(struct tcpr_ether_addr)); 370 371 return(&sp->ether); 371 372 }
