* When moving interfaces between vnet instances we need a way to * query the dlt and hdrlen before detach so we can re-attch the if_bpf * after the vmove. We unfortunately have no device driver infrastructure * to query the interface for these values after creation/attach, thus * add this as a workaround. */
| 2720 | * add this as a workaround. |
| 2721 | */ |
| 2722 | int |
| 2723 | bpf_get_bp_params(struct bpf_if *bp, u_int *bif_dlt, u_int *bif_hdrlen) |
| 2724 | { |
| 2725 | |
| 2726 | if (bp == NULL) |
| 2727 | return (ENXIO); |
| 2728 | if (bif_dlt == NULL && bif_hdrlen == NULL) |
| 2729 | return (0); |
| 2730 | |
| 2731 | if (bif_dlt != NULL) |
| 2732 | *bif_dlt = bp->bif_dlt; |
| 2733 | if (bif_hdrlen != NULL) |
| 2734 | *bif_hdrlen = bp->bif_hdrlen; |
| 2735 | |
| 2736 | return (0); |
| 2737 | } |
| 2738 | #endif |
| 2739 | |
| 2740 | /* |