Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing spoofmac field is causing interface rules malfunction. #195

Closed
VIKMSTR opened this issue Jan 31, 2022 · 1 comment · Fixed by #200
Closed

Missing spoofmac field is causing interface rules malfunction. #195

VIKMSTR opened this issue Jan 31, 2022 · 1 comment · Fixed by #200
Assignees
Labels
bug Something isn't working

Comments

@VIKMSTR
Copy link

VIKMSTR commented Jan 31, 2022

Describe the bug
Missing spoofmac field in the XML configuration
To Reproduce
Steps to reproduce the behavior:

  1. Create new vlan
  2. Assign new interface with the newly created LAN
  3. Export the XML configuration
  4. See the differences between newly created and original interfaces.

Expected behavior
Unlike other interfaces, the empty field is missing from the interface configuration of newly created interface. This causes, that the newly created interface is handled incorrectly and cannot load rules attached to it.

When opening in GUI and clicking Save on the interface editation page, the empty field is added and rules are correctly loaded.

Sending empty value for spoofmac attribute is not possible, due to mac validation on the API endpoint.

Screenshots or Response
exported config.xml

                <opt14>
			<descr><![CDATA[OPT14]]></descr>
			<if>vmx2</if>
			<spoofmac></spoofmac>
		</opt14>
		<opt15>
			<if>vmx0.89</if>
			<descr><![CDATA[OPT15]]></descr>
			<ipaddr>192.49.21.21</ipaddr>
			<subnet>24</subnet>
			<ipaddrv6>dhcp6</ipaddrv6>
			<ipv6usev4iface></ipv6usev4iface>
		</opt15>

OPT14 is created manually, OPT15 via API

pfSense Version & Package Version:

  • pfSense Version: [e.g. pfSense 2.5.2]
  • Package Version [e.g. v1.2.4]

Affected Endpoints:

  • URL: [e.g. /api/v1/interface]

Additional context
Is this issue fixed on a later versions of the API? Maybe it is already solved with newer release, IDK.

@jaredhendrickson13
Copy link
Owner

Hey!

Thanks for bringing this up. pfSense usually treats missing values and empty values the same therefor this usually wouldn't cause any issues but of course that's not always the case; but I haven't looked deeper into the code to verify. Regardless, you are correct it would be best to default that value to an empty string if none was specified and allow interface updates to revert to the default (empty) value. I'll get this fixed, I have a patch planned for release this weekend so I'll have this included.

Thanks!

@jaredhendrickson13 jaredhendrickson13 added the bug Something isn't working label Feb 20, 2022
@jaredhendrickson13 jaredhendrickson13 linked a pull request Feb 20, 2022 that will close this issue
@jaredhendrickson13 jaredhendrickson13 self-assigned this Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants