[Dhcp-agent-commits] dhcp-agent dhcp-agent.h,1.67,1.68 dhcp-client.c,1.44,1.45 dhcp-icmp-discovery.c
Status: Alpha
Brought to you by:
actmodern
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv29039 Modified Files: dhcp-agent.h dhcp-client.c dhcp-icmp-discovery.c dhcp-icmp.c dhcp-packet-build.c dhcp-sysconf.c Log Message: fixed icmp echo stupidity -- now uses proper dest mac address Index: dhcp-agent.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** dhcp-agent.h 12 Oct 2002 22:54:50 -0000 1.67 --- dhcp-agent.h 13 Oct 2002 22:17:13 -0000 1.68 *************** *** 554,559 **** extern void build_icmp_mask_reply(rawnet_t *net, uint32_t id, uint32_t seq, uint32_t subnet_mask); extern void build_icmp_echo_request(rawnet_t *net, ip_addr_t source_addr, ip_addr_t dest_addr, ! eth_addr_t source_mac, eth_addr_t dest_mac, uint32_t id, ! uint32_t seq); /* ICMP discovery routines. */ --- 554,559 ---- extern void build_icmp_mask_reply(rawnet_t *net, uint32_t id, uint32_t seq, uint32_t subnet_mask); extern void build_icmp_echo_request(rawnet_t *net, ip_addr_t source_addr, ip_addr_t dest_addr, ! eth_addr_t source_mac, eth_addr_t dest_mac, uint16_t id, ! uint16_t seq); /* ICMP discovery routines. */ *************** *** 739,744 **** extern void icmp_mask_set_seq(icmp_obj *icmp, uint32_t seq); extern void icmp_mask_set_mask(icmp_obj *icmp, uint32_t mask); ! extern void icmp_echo_set_id(icmp_obj *icmp, uint32_t id); ! extern void icmp_echo_set_seq(icmp_obj *icmp, uint32_t seq); extern uint8_t icmp_get_type(icmp_obj *icmp); --- 739,744 ---- extern void icmp_mask_set_seq(icmp_obj *icmp, uint32_t seq); extern void icmp_mask_set_mask(icmp_obj *icmp, uint32_t mask); ! extern void icmp_echo_set_id(icmp_obj *icmp, uint16_t id); ! extern void icmp_echo_set_seq(icmp_obj *icmp, uint16_t seq); extern uint8_t icmp_get_type(icmp_obj *icmp); Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** dhcp-client.c 13 Oct 2002 16:29:42 -0000 1.44 --- dhcp-client.c 13 Oct 2002 22:17:14 -0000 1.45 *************** *** 33,37 **** /* forward declarations of do_ routines. */ - static void do_version(char *interface); static void do_kill_client(char *interface); --- 33,36 ---- *************** *** 416,420 **** * semicolons) */ ! setup_interrupt_handlers(); /* setup signal handling */ if((dc = create_dhcp_client_control(interface, promiscuous)) == NULL) { --- 415,419 ---- * semicolons) */ ! // setup_interrupt_handlers(); /* setup signal handling */ if((dc = create_dhcp_client_control(interface, promiscuous)) == NULL) { Index: dhcp-icmp-discovery.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-icmp-discovery.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** dhcp-icmp-discovery.c 12 Oct 2002 22:54:50 -0000 1.18 --- dhcp-icmp-discovery.c 13 Oct 2002 22:17:14 -0000 1.19 *************** *** 119,128 **** int icmp_do_echo(rawnet_t *net, ip_addr_t dest_addr, eth_addr_t dest_mac) { ! uint32_t id, seq; struct timeval before, after, difference; int latency; ! id = get_random_uint32(); ! seq = get_random_uint32(); build_icmp_echo_request(net, net->ip_addr, dest_addr, net->hw_addr, dest_mac, id, seq); --- 119,128 ---- int icmp_do_echo(rawnet_t *net, ip_addr_t dest_addr, eth_addr_t dest_mac) { ! uint16_t id, seq; struct timeval before, after, difference; int latency; ! id = get_random_uint16(); ! seq = 1; build_icmp_echo_request(net, net->ip_addr, dest_addr, net->hw_addr, dest_mac, id, seq); Index: dhcp-icmp.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-icmp.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dhcp-icmp.c 12 Oct 2002 22:54:50 -0000 1.9 --- dhcp-icmp.c 13 Oct 2002 22:17:14 -0000 1.10 *************** *** 84,95 **** } ! void icmp_echo_set_id(icmp_obj *icmp, uint32_t id) { ! icmp->icmp_msg.echo.icmp_id = htonl(id); } ! void icmp_echo_set_seq(icmp_obj *icmp, uint32_t seq) { ! icmp->icmp_msg.echo.icmp_seq = htonl(seq); } --- 84,95 ---- } ! void icmp_echo_set_id(icmp_obj *icmp, uint16_t id) { ! icmp->icmp_msg.echo.icmp_id = htons(id); } ! void icmp_echo_set_seq(icmp_obj *icmp, uint16_t seq) { ! icmp->icmp_msg.echo.icmp_seq = htons(seq); } Index: dhcp-packet-build.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-packet-build.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dhcp-packet-build.c 12 Oct 2002 22:54:50 -0000 1.8 --- dhcp-packet-build.c 13 Oct 2002 22:17:14 -0000 1.9 *************** *** 159,163 **** static void build_eth(rawnet_t *net, eth_addr_t source_hw_addr, eth_addr_t dest_hw_addr, uint16_t type) { ! build_eth_proc(net, source_hw_addr, eth_broadcast, type); return; } --- 159,163 ---- static void build_eth(rawnet_t *net, eth_addr_t source_hw_addr, eth_addr_t dest_hw_addr, uint16_t type) { ! build_eth_proc(net, source_hw_addr, dest_hw_addr, type); return; } *************** *** 463,469 **** } ! static void build_icmp_echo_request_proc(rawnet_t *net, uint32_t id, uint32_t seq) { ! icmp_echo_set_id(net->icmp_p, seq); icmp_echo_set_seq(net->icmp_p, seq); --- 463,469 ---- } ! static void build_icmp_echo_request_proc(rawnet_t *net, uint16_t id, uint16_t seq) { ! icmp_echo_set_id(net->icmp_p, id); icmp_echo_set_seq(net->icmp_p, seq); *************** *** 473,478 **** /* build icmp echo request. */ void build_icmp_echo_request(rawnet_t *net, ip_addr_t source_addr, ip_addr_t dest_addr, ! eth_addr_t source_mac, eth_addr_t dest_mac, uint32_t id, ! uint32_t seq) { int ip_len = IP_HDR_LEN + --- 473,478 ---- /* build icmp echo request. */ void build_icmp_echo_request(rawnet_t *net, ip_addr_t source_addr, ip_addr_t dest_addr, ! eth_addr_t source_mac, eth_addr_t dest_mac, uint16_t id, ! uint16_t seq) { int ip_len = IP_HDR_LEN + Index: dhcp-sysconf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-sysconf.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dhcp-sysconf.c 12 Oct 2002 22:54:50 -0000 1.29 --- dhcp-sysconf.c 13 Oct 2002 22:17:14 -0000 1.30 *************** *** 155,162 **** --- 155,164 ---- rt = route_open(); if(rt == NULL) { + ERROR_MESSAGE("unable to open routing table: %s", strerror(errno)); return -1; } if(route_add(rt, &r_entry) < 0) { + ERROR_MESSAGE("unable to add route: %s", strerror(errno)); route_close(rt); return -1; *************** *** 356,360 **** sysconf_handlers[i].flag &= ~SYSCONF_DO_CLEANUP; ! WARN_MESSAGE("setup option: %s: %s", dhcp_options_strings[i]); } else { --- 358,362 ---- sysconf_handlers[i].flag &= ~SYSCONF_DO_CLEANUP; ! WARN_MESSAGE("unable to setup option: %s", dhcp_options_strings[i]); } else { |