linux-kernel

Using socket AF_PACKET / SOCK_RAW but tell kernel to not send RST

早过忘川 提交于 2020-07-05 12:43:11
问题 My question has roughly been discussed here. And the tl;dr solution is to do: iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP And you could modify this to only block the port you're actively listening after. But as mentioned in the above question, and here, these are not elegant solutions. Now, I don't really care about the elegance of things. But I do care about learning. So I've dug deep into the Linux source code (mostly interested in Linux based machines for now) and sorted through

Invalid argument“ setting key ”net.core.somaxconn"

烈酒焚心 提交于 2020-07-04 09:10:47
问题 I tried setting Linux kernel. After editing /etc/sysctl.conf and executing the sysctl -p it shows error Invalid argument" setting key "net.core.somaxconn" Linux distribution: Ubuntu 12.04.4 LTS, x86_64, 3.2.0-60-generic $ cat /etc/sysctl.conf net.ipv4.conf.eth0.arp_notify = 1 vm.swappiness = 0 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216

Invalid argument“ setting key ”net.core.somaxconn"

左心房为你撑大大i 提交于 2020-07-04 09:07:16
问题 I tried setting Linux kernel. After editing /etc/sysctl.conf and executing the sysctl -p it shows error Invalid argument" setting key "net.core.somaxconn" Linux distribution: Ubuntu 12.04.4 LTS, x86_64, 3.2.0-60-generic $ cat /etc/sysctl.conf net.ipv4.conf.eth0.arp_notify = 1 vm.swappiness = 0 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216

How to use the kernel hashtable API?

半世苍凉 提交于 2020-07-03 03:54:19
问题 I'm trying to understand and use the kernel hash tables and I've already read this and this link, but I didn't understand none of them. My first question is: Why our struct has to have the struct h_list inside it? If we're gonna access our struct through the struct h_list our struct shouldn't be within struct h_list and not the opposite? After reading the tutorial I've tried to write the following code: DECLARE_HASHTABLE(nodes_hash, 3) hash_init(nodes_hash); struct h_node{ int data; char name

How do Linux GPIO numbers get their values?

喜欢而已 提交于 2020-06-28 18:09:28
问题 I am trying to understand how the Linux GPIO numbers get their values. e.g. GPIO mapping for Joule. I tried reading linux documentation on Pinctrl Subsystem and also looked at the code of GPIO driver being used in Intel Joule : https://elixir.bootlin.com/linux/latest/source/drivers/pinctrl/intel/pinctrl-broxton.c However going this way looks very platform-specific. I am looking for some generic industry standard. Please help or please direct me to some good article. 回答1: First of all, one has

How do Linux GPIO numbers get their values?

淺唱寂寞╮ 提交于 2020-06-28 18:03:20
问题 I am trying to understand how the Linux GPIO numbers get their values. e.g. GPIO mapping for Joule. I tried reading linux documentation on Pinctrl Subsystem and also looked at the code of GPIO driver being used in Intel Joule : https://elixir.bootlin.com/linux/latest/source/drivers/pinctrl/intel/pinctrl-broxton.c However going this way looks very platform-specific. I am looking for some generic industry standard. Please help or please direct me to some good article. 回答1: First of all, one has

Unable to understand how the “current” macro works for x86 architecture

白昼怎懂夜的黑 提交于 2020-06-28 05:30:57
问题 I was trying to understand how current macro works, so started browsing the Linux Kernel source code version 4.19. Was trying to understand for x86 architecture include/asm-generic/current.h:8 #define get_current() (current_thread_info()->task) #define current get_current() I then tried to find the definition of current_thread_info(). include/linux/thread_info.h #ifdef CONFIG_THREAD_INFO_IN_TASK /* * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the * definition of

Unable to understand how the “current” macro works for x86 architecture

主宰稳场 提交于 2020-06-28 05:29:21
问题 I was trying to understand how current macro works, so started browsing the Linux Kernel source code version 4.19. Was trying to understand for x86 architecture include/asm-generic/current.h:8 #define get_current() (current_thread_info()->task) #define current get_current() I then tried to find the definition of current_thread_info(). include/linux/thread_info.h #ifdef CONFIG_THREAD_INFO_IN_TASK /* * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the * definition of

PIN muxing in embedded Linux kernel

♀尐吖头ヾ 提交于 2020-06-28 03:57:34
问题 I am using SAMA5D27-SOM1-EK1 Microchip embedded board. I am using Linux kernel 4.14.73 version that I build using Yocto project. That board has a J27 connector that is used as Image Sensor Interface as shown in 4.3.2 Title, page 31 from the board user guide document, besides, Table 4-16. ISC Connector J27 Pin Assignment, page 32 , shows the connector PIN features. This is a link to the board document : SAMA5D27_User_guide My goal is to change some PIN features of this connector, in order to

PIN muxing in embedded Linux kernel

最后都变了- 提交于 2020-06-28 03:57:00
问题 I am using SAMA5D27-SOM1-EK1 Microchip embedded board. I am using Linux kernel 4.14.73 version that I build using Yocto project. That board has a J27 connector that is used as Image Sensor Interface as shown in 4.3.2 Title, page 31 from the board user guide document, besides, Table 4-16. ISC Connector J27 Pin Assignment, page 32 , shows the connector PIN features. This is a link to the board document : SAMA5D27_User_guide My goal is to change some PIN features of this connector, in order to