Skip to content

BPF: strip scope id when getting routes from {Open,Net,Free}BSD#5044

Open
gpotter2 wants to merge 1 commit into
secdev:masterfrom
gpotter2:bpf-scopeid
Open

BPF: strip scope id when getting routes from {Open,Net,Free}BSD#5044
gpotter2 wants to merge 1 commit into
secdev:masterfrom
gpotter2:bpf-scopeid

Conversation

@gpotter2

Copy link
Copy Markdown
Member

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.22%. Comparing base (de33992) to head (06cc6a6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5044      +/-   ##
==========================================
+ Coverage   80.13%   80.22%   +0.08%     
==========================================
  Files         388      388              
  Lines       96467    96473       +6     
==========================================
+ Hits        77308    77391      +83     
+ Misses      19159    19082      -77     
Files with missing lines Coverage Δ
scapy/arch/bpf/pfroute.py 92.64% <100.00%> (+0.13%) ⬆️

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@evverx

evverx commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

I printed conf.ifaces with this PR included and the scope ids are no longer embedded.

NetBSD: https://github.com/evverx/avahi/actions/runs/29538591476/job/87755650477?pr=3

Source  Index  Name    MAC                IPv4       IPv6                   
BPF     1      vioif0  52:54:00:12:34:56  10.0.2.15  fe80::5054:ff:fe12:3456
BPF     2      lo0     00:00:00:00:00:00  127.0.0.1  ::1                    
                                                     fe80::1                

OpenBSD: https://github.com/evverx/avahi/actions/runs/29538591476/job/87755650434?pr=3

Source  Index  Name    MAC                IPv4       IPv6                     
BPF     1      em0     52:54:00:12:34:56  10.0.2.15  fe80::5054:ff:fe12:3456  
                                                     fec0::dd27:a29:7b7b:4029 
                                                     fec0::70af:8863:a099:e28c
BPF     3      lo0     00:00:00:00:00:00  127.0.0.1  ::1                      
                                                     fe80::1                  
BPF     4      pflog0  00:00:00:00:00:00                                      

I also pulled it on a Mac and the scope ids aren't embedded there either. Packets it sends no longer include scope ids in the sense that the source is fe80::* instead of fe80:d::* on the receiving side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scope ids get embedded into IPv6 link-local addresses on OpenBSD, NetBSD and macOS

2 participants