@@ -1033,15 +1033,25 @@ func (h *Handle) LinkSetNsFd(link Link, fd int) error {
10331033// LinkSetXdpFd adds a bpf function to the driver. The fd must be a bpf
10341034// program loaded with bpf(type=BPF_PROG_TYPE_XDP)
10351035func LinkSetXdpFd (link Link , fd int ) error {
1036- return LinkSetXdpFdWithFlags (link , fd , 0 )
1036+ return pkgHandle .LinkSetXdpFdWithFlags (link , fd , 0 )
1037+ }
1038+
1039+ func (h * Handle ) LinkSetXdpFd (link Link , fd int ) error {
1040+ return h .LinkSetXdpFdWithFlags (link , fd , 0 )
10371041}
10381042
10391043// LinkSetXdpFdWithFlags adds a bpf function to the driver with the given
10401044// options. The fd must be a bpf program loaded with bpf(type=BPF_PROG_TYPE_XDP)
10411045func LinkSetXdpFdWithFlags (link Link , fd , flags int ) error {
1046+ return pkgHandle .LinkSetXdpFdWithFlags (link , fd , flags )
1047+ }
1048+
1049+ // LinkSetXdpFdWithFlags adds a bpf function to the driver with the given
1050+ // options. The fd must be a bpf program loaded with bpf(type=BPF_PROG_TYPE_XDP)
1051+ func (h * Handle ) LinkSetXdpFdWithFlags (link Link , fd , flags int ) error {
10421052 base := link .Attrs ()
1043- ensureIndex (base )
1044- req := nl . NewNetlinkRequest (unix .RTM_SETLINK , unix .NLM_F_ACK )
1053+ h . ensureIndex (base )
1054+ req := h . newNetlinkRequest (unix .RTM_SETLINK , unix .NLM_F_ACK )
10451055
10461056 msg := nl .NewIfInfomsg (unix .AF_UNSPEC )
10471057 msg .Index = int32 (base .Index )
0 commit comments