Page MenuHomeFreeBSD

syslogd: Added -M option that limit maximum length of forwarded message
ClosedPublic

Authored by dmitry.wagin_ya.ru on Nov 13 2020, 3:28 PM.

Details

Summary

There's an enhancement to syslogd(8).

Added -M option that limit maximum length of forwarded message.
Initially syslogd had forwarded 1024-bytes messages (RFC 3164). But after D15011 forwarded messages has been truncated to 480 octets (for IPv4).
The patch allows to truncate messages by -M option (default 1024).
MAXLINE constant has been increased up to 8192 octets, corresponded to D27205.
Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

0mp added inline comments.
usr.sbin/syslogd/syslogd.8
247

Please start new sentences with new lines.

247

How about Set the limit on the length of forwarded message?

Also, I'm not sure but it might be necessary to add the before minimum and maximum.

248
usr.sbin/syslogd/syslogd.c
397

Is this desired? MAXPATHLEN is not mentioned in the description of the change.

usr.sbin/syslogd/syslogd.c
397

Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive.

man:
Moved new sentences to new lines.
Added articles.

dmitry.wagin_ya.ru added inline comments.
usr.sbin/syslogd/syslogd.8
247

I don't know about it. I'm not an English-native, sorry.

Initially syslogd had forwarded 1024-bytes messages (RFC 3164). But after D15011 forwarded messages has been truncated to 480 octets (for IPv4).

The reasoning is given in RFC 5426. I tend to agree that this is too conservative.

usr.sbin/syslogd/syslogd.c
672

I suggest "minimum maximum length of forwarded messages is 480 bytes".

720

I would write it a bit shorter, e.g., "RFC 3164 messages may not exceed 1024 bytes"

This revision is now accepted and ready to land.Mon, Mar 22, 5:06 PM
This revision now requires review to proceed.Mon, Mar 22, 9:14 PM
dmitry.wagin_ya.ru added inline comments.
usr.sbin/syslogd/syslogd.c
672

Maybe better "minimum length limit of forwarded messages is 480 bytes"?

usr.sbin/syslogd/syslogd.c
672

That's better, thanks.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Mar 23, 4:53 PM
This revision was automatically updated to reflect the committed changes.