Skip to content

socket error: Permission denied! #1

Description

@DoSeek

`

  client_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);

if (client_fd == -1)

{

    printf("socket error: %s!\n", strerror(errno));

    return ret;

}

`
test on CentOS7, Ubutun 18.04, throw exception:
[myk@sz Test]$ ./ping www.baidu.com
socket error: Permission denied!
ping result: -1

even though use 'sudo':
[myk@sz Test]$ sudo ./ping www.baidu.com
[sudo] password for myk:
socket error: Permission denied!
ping result: -1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions