Giter VIP home page Giter VIP logo

improxy's People

Contributors

haibbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

improxy's Issues

commit 4a7f5e2c4c1 breaks improxy

I have some troubles with this commit.

I tested improxy five months ago and reverted this commit because I don't need to forward packets from one downstream to other interfaces. After that my router started to forward IPv6 multicast from wan to lan correctly.

I decided to check it again.
In this commit you disabled k_mcast_msfilter.
As a result, Linux Kernel sends MLD2 reports (leaves) with incorect record type.
Attachment contains additional information:

2018-07-02 13:06:00.058 INFO(wan): Expecting MLDv2 record type CHANGE_TO_INCLUDE_MODE for group ff0e::1, but found CHANGE_TO_EXCLUDE_MODE

ERROR[init_mproxy4@332]: can't create igmp socket

Hi,
I need to forward IGMPv3 messages from enp0s8 to enp0s9, my .conf is this:

igmp enable version 3
mld enable
upstream enp0s8
downstream enp0s9

But I get the following error:

DEBUG[main@580]: logLevel = 5
DEBUG[load_config@76]: buffer = igmp enable version 3
DEBUG[load_config@94]: token is igmp
DEBUG[load_config@76]: buffer = mld enable
DEBUG[load_config@94]: token is mld
DEBUG[load_config@76]: buffer = upstream enp0s8
DEBUG[load_config@94]: token is upstream
DEBUG[load_config@185]: upstream interface is enp0s8
DEBUG[load_config@76]: buffer = downstream enp0s9
DEBUG[load_config@94]: token is downstream
DEBUG[load_config@194]: downstream interface is enp0s9
DEBUG[init_interface@189]: enp0s9's ipv6 address is fe80::a00:27ff:feff:4040
DEBUG[init_interface@195]: if_index = 4
DEBUG[init_interface@208]: if_mtu = 1500
DEBUG[init_interface@214]: if_falgs = 4163
DEBUG[init_interface@189]: enp0s8's ipv6 address is fe80::a00:27ff:fe89:fa25
DEBUG[init_interface@195]: if_index = 3
DEBUG[init_interface@208]: if_mtu = 1500
DEBUG[init_interface@214]: if_falgs = 4163
DEBUG[init_interface@178]: enp0s9's ipv4 address is 192.168.2.2
DEBUG[init_interface@195]: if_index = 4
DEBUG[init_interface@208]: if_mtu = 1500
DEBUG[init_interface@214]: if_falgs = 4163
DEBUG[init_interface@178]: enp0s8's ipv4 address is 192.168.1.1
DEBUG[init_interface@195]: if_index = 3
DEBUG[init_interface@208]: if_mtu = 1500
DEBUG[init_interface@214]: if_falgs = 4163
ERROR[init_mproxy4@332]: can't create igmp socket
ERROR[main@619]: exiting.........

Do you have an idea why igmp socket can be created?

Running on Ubuntu VM:

description: Computer
width: 64 bits
capabilities: vsyscall32
*-core
description: Motherboard
physical id: 0
*-memory
description: System memory
physical id: 0
size: 16GiB
*-cpu
product: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
vendor: Intel Corp.
physical id: 1
bus info: cpu@0
width: 64 bits

Thanks

IPv4 Multicast Address is judged non-multciast-address

First of all, thanks you a lot for this package.
It does help me solve the problem. The only one workable for IGMP/MLD proxy I can find.
Thank You.

I try this software on a ARM little endian and got some warning message as title.
I fix it and attach the changes. Hope this help someone.

input.c, the "ntohl" part is not existed in original code. I add this to fix the problem.

} else if(p_pia->ss.ss_family == AF_INET) {

    if (!IN_MULTICAST(ntohl(p_pia->v4.sin_addr.s_addr))) {
        IMP_LOG_ERROR("group address %s isn't multicast adddress\n",
                      imp_pi_ntoa(p_pia));
        return -1;
    }

    /*
     *    Address Range                 Size       Designation
     *    -------------                 ----       -----------
     *    224.0.0.0 - 224.0.0.255       (/24)      Local Network Control Block
     *
     *    Addresses in the Local Network Control Block are used for protocol
     *    control traffic that is not forwarded off link.
     *    [RFC 5771 section 4]
     */

enhncments suggestions

Hello and thank you for this igmp/mld proxy code
I run some static code analysis on it and I would like to share somes results with you

  1. input.c mcast_recv_igmp() => unreachable code : else if (ip->protocol == 0)
  2. proxy.c main() => unreachable code : free_resource();
    I think the proxy need to handle system signal in order to cleanup ressources
  3. output.c send_igmp_mld_query() => unreachable code : if(p_if == NULL) (line 84)
  4. proxy.c load_config() => resource lost : need to close fd
  5. output.c send_igmp_mld_query() => possible memory leak : p = malloc(max_len)
    if family is neither AF_INET nor AF_INET6

I hope it help
Best Reagrds

imp_get_mfcc_ttls() and iface index

Function imp_get_mfcc_ttls() checks that

p_if->if_index < length

where length is MAXVIFS (32 for linux).

But interface index may be greater than this value.
SOHO routers may have 40 interfaces (e.g. Realtek-based routers with real and virtual wifi interfaces, wds etc). As a result, eth1 (wan) and br0 (lan) have indexes greater than 32 and improxy doesn't call
imp_membership_db_mfc_add() because imp_get_mfcc_ttls returns 0.

I don't quite understand this limitation. I removed it for my device. But as a generic solution, maybe you should check the number of interfaces for which you call k_add_ip6_mif or k_add_ip4_vif.

access to a memory that has been free

Dear author:
I would like to report a problem (bug).

at source_timer_handler() in data.c, the code segment could have crash risk.

The imp_group_cleanup(p_gp) will free (p_gp) at end of that function.
After return, the last line "imp_membership_db_update(&p_gp->group_addr);"

reference it again. But p_gp is freed. So, that could have problem with some compiler or system..

if(p_gp->type == GROUP_INCLUDE && imp_source_exist_allow(p_gp) == 0){

    /* If there are no more source records for the group, delete group record.
     * rfc 3376 [6.3]
     */
    imp_group_cleanup(p_gp);
}
imp_membership_db_update(&p_gp->group_addr);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.