Comments (9)
Good catch, this is a really old code base! The current regexp in cftoken.l
looks like this:
ifname [a-zA-Z]+[0-9]+
Any input on how to improve it is welcome.
from pim6sd.
How about this? This would also work with new "predictable" interface names from systemd, e.g. enp0s25.
ifname [a-zA-Z][a-zA-Z0-9_-]*
from pim6sd.
This is probably tricky to get absolutely right if we don't find the limitations in the given network stacks.
On Linux even 0
would be a valid interface name.
9: 0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether ba:df:9b:91:f8:1f brd ff:ff:ff:ff:ff:ff
And -
:
10: -: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 5e:e0:56:eb:5a:b8 brd ff:ff:ff:ff:ff:ff
Heck, even hanky is a valid interface name.
12: 💩: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether c6:d8:3a:a7:35:1a brd ff:ff:ff:ff:ff:ff
from pim6sd.
All weird interface names that are possible aside, I think a dot followed by numbers is vital for VLAN interfaces (like enp2s0.100).
from pim6sd.
Replacing the regex does not seem to be enough to make it accept the syntax.
from pim6sd.
Uh, not sure it's even possible to support all the weird variants there ... but I guess any string that doesn't have whitespace is the least worst guess.
Yeah I noticed this right now, changing the regex doesn't bite and the parser just says error, very annoying. I'll see what I can do after work today to enable debug of the parser. No luck so far, but it should be fixable.
from pim6sd.
I've just pushed what I have in my patch queue. There's one commit that enables the built-in .conf parse debugger, activated when you run pim6sd -n -d all -c file.conf
I'll have a closer look at this mystery tonight. Thank you for the reports so far! :)
from pim6sd.
It seems to try and tokenize br
and lan
separately.
/usr/src/pim6sd/src/pim6sd -d all -c ../pim6sd.conf
debug level 0xffffffffffffffff (mld_proto,mld_timer,mld_member,switch,trace,timeout,pkt,interfaces,kernel,cache,rsrr,pim_detail,pim_hello,pim_register,pim_join_prune,pim_bootstrap,pim_asserts,pim_cand_rp,pim_routes,pim_timers,pim_rpf)
<3>comment [#The timer granularity.] (23)
<3>comment [#More this value is small,more pim6sd will be accurate ] (55)
<3>comment [#default if not specified : 5] (29)
<3>comment [#BE SURE to have to same granularity on ALL routers,] (52)
<3>comment [#otherwise....] (14)
<3>comment [#granularity 5;] (15)
<3>comment [#syntax : phyint <interface> <disable> <metric> [metric] <preference> [preference]] (82)
<3>comment [#metric and pref are for the asserts messages] (45)
<3>comment [#samples :] (10)
<3>begin phyint [phyint] (6)
<7>lo
<9>disable
<9>end phyint [;] (1)
<3>begin phyint [phyint] (6)
<7>ppp0
<9>disable
<9>end phyint [;] (1)
<3>begin phyint [phyint] (6)
<7>enp1s0
<9>disable
<9>end phyint [;] (1)
<3>begin phyint [phyint] (6)
<7>enp2s0
<9>disable
<9>end phyint [;] (1)
<3>begin phyint [phyint] (6)
<7>enp3s0
<9>disable
<9>end phyint [;] (1)
<3>begin phyint [phyint] (6)
<7>br
-<9>lan
../pim6sd.conf 18: syntax error
../pim6sd.conf 18: fatal parse failure: exiting (1 errors)
from pim6sd.
Yup, that was it. Also turns out the tokenizer looked for the 'string' regexp as follow-up token to phyint rather than the 'ifname' regexp, that's why any changes to that regexp didn't bite.
Note: it seems the .conf file parser currently requires a ';' to end a statement. I'll look into making that optional later.
from pim6sd.
Related Issues (20)
- Make ; at end of line in .conf file optional
- Convert configuration directives from underscore to dashes
- Missing pim-join-prune in 3 router setup HOT 5
- Not forwarding multicast (Linux kernel (config) issue?) HOT 3
- Timer accuracy is way off HOT 3
- PIM Decapsulation HOT 1
- segfault in age_routes() HOT 6
- undefined reference to `yywrap' HOT 6
- Please Tag a Release HOT 2
- Code cleanup, test on musl libc using Alpine or Void Linux HOT 1
- Protocol not available HOT 4
- crash in make_mld6v2_msg with mld6v2 HOT 6
- Cannot run at the same time as pimd HOT 6
- Seg fault when interface is missing link-local address HOT 2
- Should we default to MLDv2 instead of MLDv1?
- ssm.conf.sample syntax error
- Exits after returned mld_type == 0, triggered by received UDP multicast packets
- segfault after ~5 seconds if an interface has no carrier HOT 2
- Potentially broken PIM checksum HOT 3
- RP-Set not refreshing / vanishing PIM bootstrap HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pim6sd.