- u0->checksum = 0;
- u0->dst_port = clib_net_to_host_u16 (UDP_DST_PORT_dhcp_to_client);
- sum0 = ip0->checksum;
- old0 = ip0->dst_address.as_u32;
- new0 = 0xFFFFFFFF;
- ip0->dst_address.as_u32 = new0;
- sum0 = ip_csum_update (sum0, old0, new0, ip4_header_t /* structure */ ,
- dst_address /* offset of changed member */ );
- ip0->checksum = ip_csum_fold (sum0);
-
- sum0 = ip0->checksum;
- old0 = ip0->src_address.as_u32;
- new0 = ia0->as_u32;
- ip0->src_address.as_u32 = new0;
- sum0 = ip_csum_update (sum0, old0, new0, ip4_header_t /* structure */ ,
- src_address /* offset of changed member */ );
- ip0->checksum = ip_csum_fold (sum0);
-
- vlib_buffer_advance (b0, -(sizeof (ethernet_header_t)));
- si0 = vnet_get_sw_interface (vnm, original_sw_if_index);
- if (si0->type == VNET_SW_INTERFACE_TYPE_SUB)
- vlib_buffer_advance (b0, -4 /* space for VLAN tag */ );
-
- mac0 = vlib_buffer_get_current (b0);
-
- hi0 = vnet_get_sup_hw_interface (vnm, original_sw_if_index);
- ei0 = pool_elt_at_index (em->interfaces, hi0->hw_instance);
- clib_memcpy (mac0->src_address, ei0->address, sizeof (ei0->address));
- clib_memset (mac0->dst_address, 0xff, sizeof (mac0->dst_address));
- mac0->type = (si0->type == VNET_SW_INTERFACE_TYPE_SUB) ?
- clib_net_to_host_u16 (0x8100) : clib_net_to_host_u16 (0x0800);
-
- if (si0->type == VNET_SW_INTERFACE_TYPE_SUB)
- {
- u32 *vlan_tag = (u32 *) (mac0 + 1);
- u32 tmp;
- tmp = (si0->sub.id << 16) | 0x0800;
- *vlan_tag = clib_host_to_net_u32 (tmp);
- }
+ u0->checksum = 0;
+ u0->dst_port = clib_net_to_host_u16 (UDP_DST_PORT_dhcp_to_client);
+ sum0 = ip0->checksum;
+ old0 = ip0->dst_address.as_u32;
+ new0 = 0xFFFFFFFF;
+ ip0->dst_address.as_u32 = new0;
+ sum0 =
+ ip_csum_update (sum0, old0, new0, ip4_header_t /* structure */ ,
+ dst_address /* offset of changed member */ );
+ ip0->checksum = ip_csum_fold (sum0);
+
+ sum0 = ip0->checksum;
+ old0 = ip0->src_address.as_u32;
+ new0 = ia0->as_u32;
+ ip0->src_address.as_u32 = new0;
+ sum0 =
+ ip_csum_update (sum0, old0, new0, ip4_header_t /* structure */ ,
+ src_address /* offset of changed member */ );
+ ip0->checksum = ip_csum_fold (sum0);