packets: Create new compose_packet() function.
[sliver-openvswitch.git] / vswitchd / bridge.c
index bcaf1d1..455bc58 100644 (file)
@@ -3811,9 +3811,12 @@ lacp_send_pdu_cb(void *aux, const struct lacp_pdu *pdu)
     error = netdev_get_etheraddr(iface->netdev, ea);
     if (!error) {
         struct ofpbuf packet;
+        struct lacp_pdu *packet_pdu;
 
-        ofpbuf_init(&packet, ETH_HEADER_LEN + LACP_PDU_LEN);
-        compose_lacp_packet(&packet, ea, pdu);
+        ofpbuf_init(&packet, 0);
+        packet_pdu = compose_packet(&packet, eth_addr_lacp, ea, ETH_TYPE_LACP,
+                                    sizeof *packet_pdu);
+        memcpy(packet_pdu, pdu, sizeof *packet_pdu);
         ofproto_send_packet(iface->port->bridge->ofproto,
                             iface->dp_ifidx, 0, &packet);
         ofpbuf_uninit(&packet);