[dhcp-agent-commits] dhcp-agent/src dhcp-packet-build.c,1.9,1.10
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2003-07-25 02:37:34
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv23344/src Modified Files: dhcp-packet-build.c Log Message: brought up to new rawnet interface Index: dhcp-packet-build.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-packet-build.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dhcp-packet-build.c 26 Jun 2003 23:56:42 -0000 1.9 --- dhcp-packet-build.c 25 Jul 2003 02:37:31 -0000 1.10 *************** *** 348,351 **** --- 348,352 ---- uint16_t ip_len, udp_len; int total_len; + eth_addr_t eth_addr; dhcp_purge(net->dhcp_p); /* clear up old options. */ *************** *** 378,393 **** ("Outgoing DHCP packet too large. I'm currently not implementing this properly so I'll have to exit!"); if(broadcast) ! build_eth_broadcast(net, net->chw_addr, ETH_TYPE_IP); else ! build_eth(net, net->chw_addr, server_hw_addr, ETH_TYPE_IP); if(broadcast) build_ip_broadcast(net, ip_len, IP_PROTO_UDP, 0); else ! build_ip(net, ip_len, IP_PROTO_UDP, net->cip_addr, server_ip_addr); build_udp(net, udp_len); ! build_dhcp_proc(net, xid, secs, net->chw_addr, ciaddr, yiaddr, siaddr, giaddr, options, broadcast, bootp_type); --- 379,396 ---- ("Outgoing DHCP packet too large. I'm currently not implementing this properly so I'll have to exit!"); + rawnet_get_hw_addr(net, ð_addr); + if(broadcast) ! build_eth_broadcast(net, eth_addr, ETH_TYPE_IP); else ! build_eth(net, eth_addr, server_hw_addr, ETH_TYPE_IP); if(broadcast) build_ip_broadcast(net, ip_len, IP_PROTO_UDP, 0); else ! build_ip(net, ip_len, IP_PROTO_UDP, rawnet_get_ip_addr(net), server_ip_addr); build_udp(net, udp_len); ! build_dhcp_proc(net, xid, secs, eth_addr, ciaddr, yiaddr, siaddr, giaddr, options, broadcast, bootp_type); *************** *** 468,473 **** { int ip_len = ICMP_HDR_LEN + 12 + IP_HDR_LEN; /* 12 bytes for the mask request. */ ! build_eth_broadcast(net, net->chw_addr, ETH_TYPE_IP); build_ip_broadcast(net, ip_len, IP_PROTO_ICMP, 0); build_icmp_mask_proc(net, ICMP_MASK, id, seq, 0); --- 471,478 ---- { int ip_len = ICMP_HDR_LEN + 12 + IP_HDR_LEN; /* 12 bytes for the mask request. */ + eth_addr_t eth_addr; ! rawnet_get_real_hw_addr(net, ð_addr); ! build_eth_broadcast(net, eth_addr, ETH_TYPE_IP); build_ip_broadcast(net, ip_len, IP_PROTO_ICMP, 0); build_icmp_mask_proc(net, ICMP_MASK, id, seq, 0); *************** *** 483,488 **** { int ip_len = IP_HDR_LEN + ICMP_HDR_LEN + 12; /* 12 bytes for the mask reply. */ ! build_eth_broadcast(net, net->chw_addr, ETH_TYPE_IP); build_ip_broadcast(net, ip_len, IP_PROTO_ICMP, 0); build_icmp_mask_proc(net, ICMP_MASK, id, seq, subnet_mask); --- 488,495 ---- { int ip_len = IP_HDR_LEN + ICMP_HDR_LEN + 12; /* 12 bytes for the mask reply. */ + eth_addr_t eth_addr; ! rawnet_get_real_hw_addr(net, ð_addr); ! build_eth_broadcast(net, eth_addr, ETH_TYPE_IP); build_ip_broadcast(net, ip_len, IP_PROTO_ICMP, 0); build_icmp_mask_proc(net, ICMP_MASK, id, seq, subnet_mask); |