* [FFmpeg-devel] [PATCH 1/2] lavf/udp: set ttl upper bound to 255
@ 2022-01-26 16:22 Zhao Zhili
2022-01-27 5:09 ` "zhilizhao(赵志立)"
0 siblings, 1 reply; 4+ messages in thread
From: Zhao Zhili @ 2022-01-26 16:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
---
libavformat/udp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 83c042d079..b441d2ea0d 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -134,7 +134,7 @@ static const AVOption options[] = {
{ "reuse", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, D|E },
{ "reuse_socket", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, .flags = D|E },
{ "broadcast", "explicitly allow or disallow broadcast destination", OFFSET(is_broadcast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
- { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, E },
+ { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 255, E },
{ "connect", "set if connect() should be called on socket", OFFSET(is_connected), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = D|E },
{ "fifo_size", "set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes", OFFSET(circular_buffer_size), AV_OPT_TYPE_INT, {.i64 = 7*4096}, 0, INT_MAX, D },
{ "overrun_nonfatal", "survive in case of UDP receiving circular buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D },
--
2.29.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavf/udp: set ttl upper bound to 255
2022-01-26 16:22 [FFmpeg-devel] [PATCH 1/2] lavf/udp: set ttl upper bound to 255 Zhao Zhili
@ 2022-01-27 5:09 ` "zhilizhao(赵志立)"
2022-01-27 15:21 ` mypopy
0 siblings, 1 reply; 4+ messages in thread
From: "zhilizhao(赵志立)" @ 2022-01-27 5:09 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Jan 27, 2022, at 12:22 AM, Zhao Zhili <quinkblack@foxmail.com> wrote:
>
> ---
> libavformat/udp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 83c042d079..b441d2ea0d 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -134,7 +134,7 @@ static const AVOption options[] = {
> { "reuse", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, D|E },
> { "reuse_socket", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, .flags = D|E },
> { "broadcast", "explicitly allow or disallow broadcast destination", OFFSET(is_broadcast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
> - { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, E },
> + { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 255, E },
> { "connect", "set if connect() should be called on socket", OFFSET(is_connected), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = D|E },
> { "fifo_size", "set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes", OFFSET(circular_buffer_size), AV_OPT_TYPE_INT, {.i64 = 7*4096}, 0, INT_MAX, D },
> { "overrun_nonfatal", "survive in case of UDP receiving circular buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D },
> --
> 2.29.2
>
This patchset is related to 'Fix setsockopt IP_MULTICAST_TTL on OpenBSD’.
https://patchwork.ffmpeg.org/project/ffmpeg/patch/Yd5jaXBCd6GP7kBh@humpty.home.comstyle.com/
Looks like it’s impossible to avoid casting int to unsigned char, so integer
overflow/truncation must be handled. Since the maximum value of TTL is 255
limited by IPv4/IPv6, set the upper bound of AVOption to fail early for
invalid value.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavf/udp: set ttl upper bound to 255
2022-01-27 5:09 ` "zhilizhao(赵志立)"
@ 2022-01-27 15:21 ` mypopy
2022-02-06 22:06 ` Marton Balint
0 siblings, 1 reply; 4+ messages in thread
From: mypopy @ 2022-01-27 15:21 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, Jan 27, 2022 at 1:09 PM "zhilizhao(赵志立)" <quinkblack@foxmail.com> wrote:
>
>
>
> > On Jan 27, 2022, at 12:22 AM, Zhao Zhili <quinkblack@foxmail.com> wrote:
> >
> > ---
> > libavformat/udp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > index 83c042d079..b441d2ea0d 100644
> > --- a/libavformat/udp.c
> > +++ b/libavformat/udp.c
> > @@ -134,7 +134,7 @@ static const AVOption options[] = {
> > { "reuse", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, D|E },
> > { "reuse_socket", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, .flags = D|E },
> > { "broadcast", "explicitly allow or disallow broadcast destination", OFFSET(is_broadcast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
> > - { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, E },
> > + { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 255, E },
> > { "connect", "set if connect() should be called on socket", OFFSET(is_connected), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = D|E },
> > { "fifo_size", "set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes", OFFSET(circular_buffer_size), AV_OPT_TYPE_INT, {.i64 = 7*4096}, 0, INT_MAX, D },
> > { "overrun_nonfatal", "survive in case of UDP receiving circular buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D },
> > --
> > 2.29.2
> >
>
> This patchset is related to 'Fix setsockopt IP_MULTICAST_TTL on OpenBSD’.
>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/Yd5jaXBCd6GP7kBh@humpty.home.comstyle.com/
>
> Looks like it’s impossible to avoid casting int to unsigned char, so integer
> overflow/truncation must be handled. Since the maximum value of TTL is 255
> limited by IPv4/IPv6, set the upper bound of AVOption to fail early for
> invalid value.
Patchset LGTM, limited the TTL(Time to live) in IPv4 <= 255 in option
is better than coding in the function
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavf/udp: set ttl upper bound to 255
2022-01-27 15:21 ` mypopy
@ 2022-02-06 22:06 ` Marton Balint
0 siblings, 0 replies; 4+ messages in thread
From: Marton Balint @ 2022-02-06 22:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, 27 Jan 2022, mypopy@gmail.com wrote:
> On Thu, Jan 27, 2022 at 1:09 PM "zhilizhao(赵志立)" <quinkblack@foxmail.com> wrote:
>>
>>
>>
>> > On Jan 27, 2022, at 12:22 AM, Zhao Zhili <quinkblack@foxmail.com> wrote:
>> >
>> > ---
>> > libavformat/udp.c | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/libavformat/udp.c b/libavformat/udp.c
>> > index 83c042d079..b441d2ea0d 100644
>> > --- a/libavformat/udp.c
>> > +++ b/libavformat/udp.c
>> > @@ -134,7 +134,7 @@ static const AVOption options[] = {
>> > { "reuse", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, D|E },
>> > { "reuse_socket", "explicitly allow reusing UDP sockets", OFFSET(reuse_socket), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, .flags = D|E },
>> > { "broadcast", "explicitly allow or disallow broadcast destination", OFFSET(is_broadcast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
>> > - { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, E },
>> > + { "ttl", "Time to live (multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 255, E },
>> > { "connect", "set if connect() should be called on socket", OFFSET(is_connected), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = D|E },
>> > { "fifo_size", "set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes", OFFSET(circular_buffer_size), AV_OPT_TYPE_INT, {.i64 = 7*4096}, 0, INT_MAX, D },
>> > { "overrun_nonfatal", "survive in case of UDP receiving circular buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D },
>> > --
>> > 2.29.2
>> >
>>
>> This patchset is related to 'Fix setsockopt IP_MULTICAST_TTL on OpenBSD’.
>>
>> https://patchwork.ffmpeg.org/project/ffmpeg/patch/Yd5jaXBCd6GP7kBh@humpty.home.comstyle.com/
>>
>> Looks like it’s impossible to avoid casting int to unsigned char, so integer
>> overflow/truncation must be handled. Since the maximum value of TTL is 255
>> limited by IPv4/IPv6, set the upper bound of AVOption to fail early for
>> invalid value.
> Patchset LGTM, limited the TTL(Time to live) in IPv4 <= 255 in option
> is better than coding in the function
Will apply.
Thanks,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-06 22:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 16:22 [FFmpeg-devel] [PATCH 1/2] lavf/udp: set ttl upper bound to 255 Zhao Zhili
2022-01-27 5:09 ` "zhilizhao(赵志立)"
2022-01-27 15:21 ` mypopy
2022-02-06 22:06 ` Marton Balint
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git