Skip to content

PPPoE: miscellaneous improvements - #140

Open
laarmen wants to merge 2 commits into
xebd:masterfrom
laarmen:pppoe_headers_cleanup
Open

laarmen wants to merge 2 commits into
xebd:masterfrom
laarmen:pppoe_headers_cleanup

Conversation

@laarmen

@laarmen laarmen commented Jun 23, 2020

Copy link
Copy Markdown
Contributor

In the course of some work on the PPPoE subsystem regarding the configuration reload, I made various modifications to the codebase that are only loosely related. This PR is the first of several for these changes.

These patches shouldn't change anything to the behavior of the program, and are only aimed at easing the development.

@laarmen
laarmen force-pushed the pppoe_headers_cleanup branch from cac1491 to 1246687 Compare June 23, 2020 09:59

@micron10 micron10 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this patch not connect pppoe users with this error :

[2020-12-20 12:24:55]: debug: vlan-mon: notify 4 100 8863 0
[2020-12-20 12:24:55]: info: pppoe: create vlan vlan100 parent eth1
[2020-12-20 12:25:00]: warn: pppoe: discarding packet (unsupported version 0)
[2020-12-20 12:25:10]: warn: pppoe: discarding packet (unsupported version 0)
[2020-12-20 12:25:25]: info: pppoe: remove vlan vlan100

@laarmen

laarmen commented Dec 20, 2020

Copy link
Copy Markdown
Contributor Author

Hi, thank you for testing this, I appreciate it very much.

Could you share a bit more details about the error case? Is it on any client, or only some of them ? Are you running on amd64 or 32-bit x86?

@micron10

micron10 commented Dec 20, 2020 via email

Copy link
Copy Markdown

@micron10

micron10 commented Dec 20, 2020 via email

Copy link
Copy Markdown

@micron10

micron10 commented Dec 21, 2020 via email

Copy link
Copy Markdown

@micron10

micron10 commented Dec 24, 2020 via email

Copy link
Copy Markdown

@laarmen

laarmen commented Dec 24, 2020 via email

Copy link
Copy Markdown
Contributor Author

This way, the client code doesn't need to know the intrinsics of how
exactly the packet data is encoded within the payload, it can just
directly access the structure fields.

A small theoretical bonus is that it makes the code a bit more portable
as the size of an `int` isn't guaranteed to be 4 bytes on every
platform. Granted, it is 32-bit on all the platforms supported by
Debian, and the Linux kernel pretty much makes the same assumption, but
it doesn't cost anything.

v2: Fix the pointer arithmetic bug that rendered the whole patch
non-functional

Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>

fixup
This patch is more for quality of life for development : if the headers
aren't self-contained, the tooling tends to complain about incomplete
types and undefined constants when editing the header file.

Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
@laarmen
laarmen force-pushed the pppoe_headers_cleanup branch from 1246687 to 64e6dcd Compare January 11, 2021 18:50
@laarmen

laarmen commented Jan 11, 2021 via email

Copy link
Copy Markdown
Contributor Author

@micron10

micron10 commented Jan 11, 2021 via email

Copy link
Copy Markdown

@laarmen

laarmen commented Jan 12, 2021 via email

Copy link
Copy Markdown
Contributor Author

@Neustradamus

Copy link
Copy Markdown

Dear @laarmen,

Can you open a PR at "good" place:

Thanks in advance.

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.

3 participants